package com.qf.j2205.controller;

import com.alibaba.fastjson.JSON;
import com.qf.j2205.entity.vo.PermissionVo;
import com.qf.j2205.service.PermissionVoService;
import com.qf.j2205.service.impl.PermissionVoServiceImpl;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

/**
 * @ClassName PermissionVoServlt
 * @Description TODO
 * @Author Windy
 * @Date 2022/8/20 11:12
 * @Version 1.0
 **/
public class PermissionVoServlet extends ServletBase{
    protected void findAll(HttpServletRequest request, HttpServletResponse response) throws IOException {

        PermissionVoService service = new PermissionVoServiceImpl();
        List<PermissionVo> all = service.findAll();
        String json= JSON.toJSONString(all);
        response.setContentType("application/json;charset=UTF-8");
        PrintWriter writer = response.getWriter();
        writer.println(json);
        writer.flush();
        writer.close();
    }
}
